import { Command } from '@/commands/command.ts'
import { new_command } from '@/models/command.ts'

export class IpCommand extends Command {
    public static new(args: string): Command {
        const command = new_command()
        command.args = args
        command.name = 'ip'
        command.component = 'NormalCommandComponent'

        return new IpCommand(command, false)
    }

    usage(): string {
        return 'ip [--source [ip-api|csdn]] IP'
    }

    description(): string {
        return `<div>查询IP地址信息，可以指定数据源，默认为ip-api，不同数据源详细程度不一致</div>
        <br/>
        <div>选项说明:</div>
        <br/>
        <div class="option-row"><span class="option-option">--source</span><span>数据源，可选: ip-api/csdn</span></div>`
    }
}
